{extend name="common/public" /}
{block name="content"}
<div class="widget-body am-fr">
    <div class="am-form-group">
        <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
                <button type="button" onclick="openUrl('{:url("add_article",['type_id'=>$Request.param.type_id])}')" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
            </div>
        </div>
    </div>
</div>
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">{$Request.param.name|default='文章列表'}</div>
            <div class="widget-function am-fr">
                <a href="javascript:;" class="am-icon-cog"></a>
            </div>
        </div>
        <div class="widget-body  widget-body-lg am-fr">

            <form action="{:url()}">
                <select name="type_id" data-am-selected="{searchBox: 2}">
                    {foreach $type_list as $v}
                    <option value="{$v.id}"  {eq name="$Request.param.type_id"  value="$v.id"}selected{/eq}>{$v.name}</option>
                    {/foreach}
                </select>
                <button type="submit" class="am-btn am-btn-xs am-btn-default am-btn-success"><span class="am-icon-search"></span> 确定</button>
            </form>
            <table width="100%" class="am-table am-table-compact am-table-bordered tpl-table-black ">
                <thead>

                <tr>
                    <th class="am-lg-text-center" style="width: 35%">
                        文章标题
                    </th>
                    <th class="am-lg-text-center">
                        是否置顶
                    </th>
                    <th class="am-lg-text-center">
                        是否显示
                    </th>
                    <th>操作</th>
                </tr>
                </thead>
                {foreach $list as $v}
                    <tr class="gradeX">
                        <th class='am-lg-text-center'> {$v.title}</th>
                        <th class="am-lg-text-center"> {eq name='$v.is_top' value='1'}是{else/}否{/eq}</th>
                        <th class="am-lg-text-center"> {eq name='$v.is_show' value='1'}是{else/}否{/eq}</th>
                        <td>
                            <div class="tpl-table-black-operation">
                                <a onclick="openUrl('{:url('edit_article',['id'=>$v['id']])}')">
                                    <i class="am-icon-pencil"></i> 编辑
                                </a>
                            </div>
                        </td>
                    </tr>
                {/foreach}
            </table>

            {$list|raw}

        </div>
    </div>
</div>

{/block}

{/extend}
